package com.example.controller;

import com.example.pojo.Result;
import com.example.pojo.User;
import com.example.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/user/login")
    public Result login(@RequestBody User user) {

        return loginService.login(user);
    }
    @GetMapping("/user/logout")
    public Result logout() {
        return loginService.logout();
    }
}
